package ihm.panel.site;

import ihm.applet.KrakenApplet;
import ihm.panel.PanelInterface;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

/**
 * Affiche l'état de la QoS des serveurs.
 * @author Guillaume Pocas & Jean-Fraçois Augé
 */
@Deprecated
public class QoSPanel extends JPanel implements PanelInterface {

	private static final long serialVersionUID = 1L;
	private KrakenApplet applet;
	
	private JLabel title_jl;
	private JPanel lowerhalf_jp;
	
	private JLabel iacheck_jl, addrules_jl;
	private JCheckBox iacheck_jcb;
	private JTextField addrules_jtf;
	private JButton addrules_jb;
	
	private String[] rules = {"rule 1", "rule 2", "rule 3"};
	private JComboBox[] rule_jcb;
	private JButton[] delete_jb;
	private JButton addrule_jb, save_jb, revert_jb;
	
	private int nbRules = 100;
	
	/**
	 * Constructeur.
	 * @param applet
	 */
	public QoSPanel(KrakenApplet applet) {
		this.applet = applet;
		initPanel();
	}
	
	@Override
	public void initPanel() {
		setLayout(new BorderLayout());
		title_jl = new JLabel("<html><u>Configuration de la Qualité de service</u></html>");
		title_jl.setFont(new Font("Tahoma", Font.PLAIN, 30));
		add(title_jl, BorderLayout.NORTH);
		
		lowerhalf_jp = new JPanel();
		JScrollPane scrollPane = new JScrollPane(lowerhalf_jp);
        add(scrollPane,  BorderLayout.CENTER);
		lowerhalf_jp.setLayout(new GridLayout(nbRules, 2));

		rule_jcb = new JComboBox[nbRules];
		delete_jb = new JButton[nbRules];
		for(int i=0; i<nbRules; i++) {
			rule_jcb[i] = new JComboBox(rules);
			delete_jb[i] = new JButton("Supprimer");
			lowerhalf_jp.add(rule_jcb[i]);
			lowerhalf_jp.add(delete_jb[i]);
		}
	}
	
}
